package com.zstu.mall.common;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * create by: wuyc
 * description: BaseEntity
 * create time: 2019/12/2 18:45
 */
//封装于不同的非实体类中
@MappedSuperclass
public abstract class BaseEntity implements Serializable {

    //序列化的机制是通过判断类的serialVersionUID来验证的版本一致
    protected static final long serialVersionUID = 1L;
    /**
     * null
     * default value: ' '
     */
    @Id
//    @GeneratedValue 数据库主键自增设置
    @Column(name = "id", nullable = false,length = 255)
    protected String id;

    /**
     * null
     * default value: '2019-10-26 00:00:00'
     */
    @CreatedDate//创建时间
    @Column(name = "gmt_create", nullable = false)
    protected java.util.Date gmtCreate;

    /**
     * null
     * default value: '2019-10-26 00:00:00'
     */
    @LastModifiedDate//修改时间
    @Column(name = "gmt_modified", nullable = false)
    protected java.util.Date gmtModified;

    /**
     * 只做逻辑上删除status = del
     * default value: '1'
     * @return
     */
    @Column(name = "status", nullable = false,length = 255)
    protected String status;

    /**
     * 对应注释
     * default value: ' '
     */
    @Column(name = "remark", nullable = false,length = 255)
    protected String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
